package cc.mxtt.mvc.service.impl;

import com.jfinal.plugin.activerecord.Page;

import cc.mxtt.mvc.model.DictDetail;
import cc.mxtt.mvc.service.DictDetailService;

public class DictDetailServiceImpl implements DictDetailService {

	@Override
	public DictDetail findById(String id) {
		return DictDetail.dao.findById(id);
	}

	@Override
	public boolean create(DictDetail dictdetail) {
		return dictdetail.save();
	}

	@Override
	public boolean update(DictDetail dictdetail) {
		return dictdetail.update();
	}

	@Override
	public boolean delete(String id) {
		return DictDetail.dao.deleteById(id);
	}

	@Override
	public Page<DictDetail> getListDictDetail(int pageNumber, int pageSize, String dictid) {
		String select = "select id,code,text,val,status";
		String formwhere = "from sys_dict_detail where dict_id=?";
		return DictDetail.dao.paginate(pageNumber, pageSize, select, formwhere, dictid);
	}

}
